<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>测试</title>
		<style type="text/css">
			#div1{
				width: 100px;
				height: 100px;
				background-color: #00FFFF;
			}
		</style>
	</head>
	<body>
		<button type="button" kang="0" id="bu1">点击</button>
		<div id="div1">
			kang1
		</div>
		<script type="text/javascript">
			var bu=document.getElementById("bu1");
			var div=document.getElementById("div1");
			bu.onclick=function(){
				var k=bu.getAttribute("kang");
				if(k==1){
					bu.setAttribute("kang","0")
					div.style.display="block";
				}
					else{
						bu.setAttribute("kang","1");
						div.style.display="none";
					}
					
			}
		</script>
	</body>
</html>
